Visualizing Alienation: Mapping Emotional Spaces in FrankensteinΒΆ
Joost Burgers with the help of Claude Sonnet V4ΒΆ
This brief analysis uses sentiment analysis to understand the emotional valence of the locations and characters in Mary Shelley's Frankenstein.
Introduction & MethodologyΒΆ
The data was created by splitting the text of Frankenstein into Vol. Chapter and paragraphs. For each paragraph, the location of the narrative present was noted. This is distinct from all the locations that are mentioned in the text. For example, South America is mentioned, but as the text never goes there it is not part of this data set. Subsequently, the roBERTa Sentiment analyzer was run on each paragraph and the aggregate score per location was registered.
A follow up analysis was performed of the sentiments surrounding each character. This is less accurate as the calculation purely replies on character name as indicative of character presence. No attempt was made to reconcile pronouns with characters. Thus, "I" could be Walton, Victor, or The Monster. Without significantly more work, these distinctions cannot be recovered from the data without supervision.
Part I: The Geographic Imagination of FrankensteinΒΆ
The text has a remarkably large geographic canvas given its relative brevity. Some of this is no doubt due to the fact that Mary Shelley traveled quite a bit during the composition of the text.
Geographic Distribution and Narrative WeightΒΆ
The map below shows all the locations in Frankenstein where the text travels. The circle sizes represent the total word count associated with each location. Note that this does not necessarily indicate how long the text stays in that location in terms of narrative duration. For example, Victor is in Ingolstadt for quite some time, but the relative amount of text there is quite small.
Interactive Geographic MapΒΆ
π Most significant locations by word count: Geneva: 24.2% (17387 words) Delacey Cottage: 14.1% (10135 words) Ingolstadt: 11.9% (8543 words) Artic: 10.6% (7583 words) Montanvert: 5.8% (4175 words)
Emotional Geography AnalysisΒΆ
Each of the locations above can also be analyzed for its emotional valence using sentiment analysis. This is an imperfect process. A sentiment analyzer uses a machine learning algorithm to figure out if the words in a sentence are "positive", "negative", or "neutral". In order to learn how to do this the algorithm has to be "trained" on real human speech. Most sentiment analyzers have been trained on product reviews online or on social media posts. These are necessarily short posts that are often charged with emotions. Emotional states in books are far more complex, so the results should be taken with a grain of salt.
β¨ Most positively framed locations: Windsor: 0.477 Edinburgh: 0.344 Chamonix: 0.333 βοΈ Most negatively framed locations: Holyhead: -0.410 Zurich: -0.238 Beach somewhere on the Irish Coast: -0.231
Animating Movements Through TimeΒΆ
We can also track where these emotions take place in time by splitting up the data further. By giving each location a chronological number, we can get the sentiment for that particular event at that particular location rather than the average sentiment per location. After all, sometimes Victor is happy in Geneva and sometimes he is sad.
Chronological Emotion AnimationΒΆ
Part II: Character Sentiment AnalysisΒΆ
We can also try to extract the emotions around each character. This is an even murkier process. As the locations were all manually identified, we can be certain that each paragraph is set at that particular location. With characters it is hard to know if they are actually present in that particular paragraph unless they are manually coded as being there. For example, Victor may mention his father in a paragraph, but Alphonse may not actually be there. Furthermore, paragraphs may simply use pronouns (he/she) to refer to a character. This then his the sentiment when a specific character is mentioned in a particular paragraph.
Character Emotional FramingΒΆ
π Character Analysis - Key Findings:
β¨ Most positively portrayed: Agatha (sentiment: 0.107)
βοΈ Most negatively portrayed: Justine (sentiment: -0.181)
π Most frequently mentioned: Father (125 paragraphs)
π Characters analyzed: 11
π Character Emotional Patterns:
Agatha: 58.8% pos, 23.5% neu, 17.6% neg (avg: 0.107)
Ernest: 42.9% pos, 35.7% neu, 21.4% neg (avg: 0.023)
Elizabeth: 33.8% pos, 28.7% neu, 37.5% neg (avg: 0.018)
Felix: 36.8% pos, 36.8% neu, 26.3% neg (avg: -0.001)
Henry: 32.3% pos, 27.7% neu, 40.0% neg (avg: -0.008)
Father: 28.0% pos, 36.8% neu, 35.2% neg (avg: -0.012)
Mother: 16.0% pos, 40.0% neu, 44.0% neg (avg: -0.032)
Victor: 15.1% pos, 41.5% neu, 43.4% neg (avg: -0.127)
William: 16.7% pos, 25.0% neu, 58.3% neg (avg: -0.130)
Monster: 16.5% pos, 25.7% neu, 57.8% neg (avg: -0.136)
Justine: 12.5% pos, 12.5% neu, 75.0% neg (avg: -0.181)
Character Sentiment InsightsΒΆ
Perhaps the most interesting contrast here is that between Agatha and Justine. The contrast can perhaps be explained by the fact that they do not appear in the text too often, therefore the emotional states surrounding them are relatively isolated. Conversely, Henry and Elizabeth are more diffuse terms throughout the text and would be more likely to be "neutral" due to positive and negative emotions surrounding them. By this same logic, we would positive and negative emotions to surround Victor as well, but these are overwhelmingly negative. This again is only when Victor is mentioned so the tokenizer won't pick up on lines where Victor simply says "I", "me", or "we", which is all the time.